<?php
declare (strict_types = 1);

namespace app\shop\controller;

use think\annotation\Route;
use think\annotation\route\Group;
use think\annotation\route\Middleware;
use app\common\service\FinancialService\BusinessStatisticsService;
use app\BaseShopController;
use think\Request;
use app\Normal;

/**
 * @Group("BusinessWithdraw")
 * @Middleware({shopMiddileware::class})
 */
class BusinessWithdraw extends BaseShopController
{
    /**
     * 获取渠道提现列表分页
     * @Route("getListByPage",method="GET")
     * @return string
     */
    public function getListByPage() {
        $result = callApi(BusinessStatisticsService::class, 'withdrawListByID',$this->_all_data);
        return apiResponse($result);
    }
    
    /**
     * 提现验证码
     * @Route("sendSms",method="GET")
     * @return string
     */
    public function sendSms() {
        $result = callApi(BusinessStatisticsService::class, 'sendSms',$this->_all_data);
        return apiResponse($result);
    }
    
    /**
     * 提现验证码
     * @Route("applyWithdraw",method="POST")
     * @return string
     */
    public function applyWithdraw() {
        $result = callApi(BusinessStatisticsService::class, 'applyWithdraw',$this->_all_data);
        if($result['code'] == Normal::SUC){
            $this->log(['content'=>'申请提现','request_param'=> json_encode($this->_all_data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]);
        }
        return apiResponse($result);
    }
    
    
}
